package com.qianfeng.day2.myclient1.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class HiController {
    @Value("${server.port}")
    private String port;
    @Value("${test_name}")
    private String testName;

    @RequestMapping("/hi")
    public String home(@RequestParam(value = "name", defaultValue = "qf") String name) {
        return "hi " + name + " ,i am from port:" + port + ", test_name:" + testName;
    }
}
